var dns = require('dns');

console.log('Resolving www.baidu.com....');

dns.resolve4('www.baidu.com', function (err, addressse) {
	console.log('IPv4 addresses: ' + JSON.stringify(addressse, false, ''));
	addressse.forEach( function(addr) {
		dns.reverse(addr, function (err, domains) {
			console.log('Reverse for ' + addr +': ' + JSON.stringify(domains));
		});
	});
});